import java.util.Random;
import Pursuit_Client.PursuitPlayer;

public class SimpleChaser implements PursuitPlayer
{
  Random generator = new Random();
  double meX;
  double meY;
  double himX;
  double himY;
  double meXVel;
  double meYVel;
  double himXVel;
  double himYVel;
  double meTheta;
  double meAngVel;
  double himTheta;
  double himAngVel;
  double meX1;
  double meY1;
  double himX1;
  double himY1;
  double meXVel1;
  double meYVel1;
  double himXVel1;
  double himYVel1;
  double meTheta1;
  double meAngVel1;
  double himTheta1;
  double himAngVel1;

  public void update(double a, double b, double c, double d, double e, double f, double g, double h, double i, double j, double k, double l)
  {
     meX1 =  meX;  meY1 =  meY;  himX1 =  himX;  himY1 =  himY;  meXVel1 =  meXVel;  meYVel1 =  meYVel;  himXVel1 =  himXVel;  himYVel1 =  himYVel;
     meTheta1 =  meTheta;  meAngVel1 =  meAngVel;  himTheta1 =  himTheta;  himAngVel1 =  himAngVel;

     meX = a;  meY = b; himX = g; himY = h; meXVel = d; meYVel = e; himXVel = j; himYVel = k; meTheta = c; meAngVel = f; himTheta = i; himAngVel = l;
  }

  public double getReducingAngAcc(double angVel)
  {
    if (angVel >= 1D)
      return -1.0D;
    if (angVel <= -1.0D)
      return 1D;
    return 0D;
  }

  public double getAcceleration() 
  {   return 1D; }

  public double getAngularAcceleration() 
  {    return getReducingAngAcc(meAngVel); }

  public String getRole() {
    return "chaser";
  }
}